﻿// ***********************************************************************
// Provided for Informational Purposes Only
//
// Apache 2.0 License
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY 
// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR 
// PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing
// permissions and limitations under the License.
// ***********************************************************************
// Assembly  : ContractMeow.Api.WinRT
// File      : IAutoCompleteClient.cs
//
// ***********************************************************************

using ContractMeow.Api.Dtos;
using ContractMeow.Api.Dtos.AutoComplete;
using System.Threading.Tasks;

namespace ContractMeow.Api.Clients
{
	/// <summary>
	/// Interface for Auto-Complete calls to the API (specifies the contract of an Auto-Complete client)
	/// </summary>
	public interface IAutoCompleteClient : IApiClient
	{
		/// <summary>
		/// Gets the users [auto complete] list (results will be ranked according to user's preferences).
		/// </summary>
		/// <param name="credentials">The credentials.</param>
		/// <param name="prefix">The first few letters to be used for the search</param>
		/// <param name="limit">Maximum number of users to bring back</param>
		/// <param name="includePendingUsers">Include a list of pending users.</param>
		/// <returns>The users matching the prefix wrapped in an instance of IAutoCompleteResults.</returns>
		Task<AutoCompleteUserEnvelope> GetUsersAutocompleteAsync(Principal credentials, string prefix, int limit = 50, bool includePendingUsers = false);

		/// <summary>
		/// Gets the groups (auto complete) list for the credentials (results will be ranked according to user's preferences)
		/// </summary>
		/// <param name="credentials"></param>
		/// <param name="prefix">The first few letters to be used for the search</param>
		/// <param name="limit">Maximums number of groups to return</param>
		/// <returns>The users matching the prefix wrapped in an instance of IAutoCompleteResults.</returns>
		Task<AutoCompleteGroupEnvelope> GetGroupsAutocompleteAsync(Principal credentials, string prefix, int limit = 50);
	}
}